// Regular-expression test.
// Two DFAs, one for ints, one for floats.
// Possible digits: -, ., \d, other

#include <iostream>
#include <string>
#include <cstdlib>

int next[9][5] = {{8,8,8,8,0},
                  {3,8,2,8,0},
                  {8,8,2,8,1},
                  {8,8,2,8,0},
                  {5,7,6,8,0},
                  {8,7,6,8,0},
                  {8,7,6,8,1},
                  {8,8,7,8,1},
                  {8,8,8,8,0}};

bool matches(const std::string& s, int initial_state) {
    int state = initial_state;
    for (int i=0; i<s.length(); i++) {
        char c = s[i];
        if      (c == '-')
            state = next[state][0];
        else if (c == '.')
            state = next[state][1];
        else if (std::isdigit(c))
            state = next[state][2];
        else
            state = next[state][3];
    }
    return next[state][4] == 1;
}

int main() {
    while (true) {
        std::string word;
        std::getline(std::cin, word);

        if (matches(word, 1))
            std::cout << "it's an int: " << atoi(word.c_str()) << "\n";
        else if (matches(word, 4))
            std::cout << "it's a float " << atof(word.c_str()) << "\n";
        else
            std::cout << "not a number\n";
    }
}




